package com.cskaoyan.wordmemorize.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cskaoyan.wordmemorize.dao.entity.RolePermissionDO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RolePermissionMapper extends BaseMapper<RolePermissionDO> {

    List<String> selectPermissionIdsByType(Long roleId);

    /**
     * 根据角色ID删除所有关联的权限
     */
    void deleteByRoleId(@Param("roleId") Long roleId);

    List<String> selectLeafPermissionIds(@Param("roleId") Long roleId);
    int updateIsDeletedByRoleIdAndPermissionId(@Param("roleId") Long roleId, @Param("permissionId") Long permissionId);
}
